import type * as Users from './type.ts';
import { request } from '@/http/axios.ts';

/** 登录接口 */
export const handlePwdLogin = async (data: Users.LoginRequestData) =>
  request({
    url: '/user/login',
    method: 'POST',
    data,
  });

/** 注册接口 */
export const handleRegisterApi = async (data: any) =>
  request({
    url: '/user/register',
    method: 'POST',
    data,
  });

/** 获取用户信息 */
export const getCurrentUserInfoApi = async () =>
  request({
    url: '/user/userInfo',
    method: 'POST',
  });

/** 修改用户信息 */
export const updateUserInfo = async (data: any) =>
  request({
    url: '/user/updateUserInfo',
    method: 'POST',
    data,
  });
